<div class="span10 well">
	<?=$system_message;?>
	<fieldset>
	<legend>Assign Shifts</legend>
	<? if(!empty($employees_on_dept)): ?>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>Employee Name</th>
					<th>Time and Shift</th>
				</tr>
			</thead>
			<tbody>
				<form action="<?=site_url('departmentshiftsupdate/'.$id);?>" method="POST">
				<?foreach($employees_on_dept as $d):?>
				<tr>
					<td><?=ucwords($d->firstname.' '.$d->middlename.' '.$d->lastname);?></td>
					<td>
					<? if($d->shift == NULL): ?>
						<?=form_dropdown('shift['.$d->emp_id.']',$time_shifts);?>
					<?else:?>
						<span class="label"><?=$d->shift;?></span>
						<?=form_dropdown('shift['.$d->emp_id.']',$time_shifts,$d->shift_id);?>
					<?endif;?>
					</td>
				</tr>
				<?endforeach;?>
				<tr>
				<td colspan="2"><input type="submit" class="btn btn-mini btn-primary" name="save_shifts" value="Save Shifts"></td>
				</tr>
			</tbody>
			</form>
		</table>
	<?else:?>
		<div class="alert alert-info">
			<h3>Notice!</h3>
			<p>No Employees assigned to this department</p>
		</div>
	<?endif;?>
	</fieldset>
</div>